require 'game'
require 'game_engine'
require 'player'
require 'player_exists_error'

@game_engine = GameEngine.new

player1 = Player.new 'Akshay'
player2 = Player.new 'Chirag'

@game_engine.add_player player1
@game_engine.add_player player2

puts player1.status
puts player2.status

@thread = Thread.new{
  loop do 
    @game_engine.use_player_strategies
    
    @game_engine.update_player_strategy 'Chirag', IO.read('/home/akshay/strategy.game')
    @game_engine.update_player_strategy 'Akshay', '10.times do create_farmer end; 10.times do farm end; 10.times do create_warrior end; puts @name +\' : \' +status'
    sleep 5 
  end
}

@thread.join